<?php
// 本类由系统自动生成，仅供测试用途
namespace Home\Controller;
use Think\Controller;

// 登录
class LoginController extends Controller {
    public function index(){
    	
    	$pwd = $this->_get('pwd','intval','');
		
		if($pwd != date('Ymd')){
			header_404();
		}
		
    	$this->assign(
    		array(
    			'APP_NAME'=>APP_NAME
    		)
    	);
    	$this->display();
    }
    
    public function login_do(){
    	
    	//用户名和密码
    	$name 	= $this->_post('name'	,'','');
		$passwd	= $this->_post('passwd'	,'','');
		
		import("@.ORG.Admin");
		$cAdmin = new Admin();

		//登录
		$login_result = $cAdmin->login($name,$passwd);
		
		json_out($login_result);
    }
    
    public function login_status(){
    	//session_destroy();
    	
    	import("@.ORG.Admin");
		$cAdmin = new Admin();
		
		//前缀
		$prefix = Admin::SESSION_PREFIX;
		
    	if(session('?'.$prefix.'id')){
    		
    	}
    }
}
?>